<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use App\Http\Services\AngerbirdServices;

class ConsumerAngerBird extends Command
{
    protected $signature = 'ConsumerAngerBird';

    protected $description = '愤怒的小鸟每局数据处理';

    protected $angerbirdService;

    protected $logName = 'angerbird';//日志名
    protected $errorLogName = 'error_angerbird';//日志名

    public function __construct()
    {
        parent::__construct();

        $this->angerbirdService = new AngerbirdServices();
    }

    public function handle()
    {
        write_log($this->logName, 'start', []);

        //开始新一局游戏并持续处理
        $result = $this->angerbirdService->gameHandle();

        write_log($this->logName, 'end', ['result'=>$result]);

        exit;
    }

}